package com.neuedu.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

//com.neuedu.servlet.FirstServlet
public class ThirdServlet extends HttpServlet {

    public void init() throws ServletException {
        System.out.println("ThirdServlet.init");
    }


    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        System.out.println("req = " + req.getClass());
        resp.setContentType("text/html;charset=utf-8");
        PrintWriter writer = resp.getWriter();
        writer.println("<h1>ThirdServlet Servlet</h1>");
        writer.flush();
        writer.close();

    }
}
